<?php
/**
 * TomatoCMS
 * 
 * LICENSE
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE Version 2 
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-2.0.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@tomatocms.com so we can send you a copy immediately.
 * 
 * @copyright	Copyright (c) 2009-2010 TIG Corporation (http://www.tig.vn)
 * @license		http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE Version 2
 * @version 	$Id: Uploader.php 4656 2010-08-15 18:12:20Z huuphuoc $
 * @since		2.0.0
 */

/**
 * This view helper show the upload form
 */
class Customer_View_Helper_ListCustomer extends Zend_View_Helper_Abstract 
{
	public function listCustomer($name,$value,$default=false){
		$conn = Tomato_Db_Connection::factory()->getMasterConnection();
		$customerDao = Tomato_Model_Dao_Factory::getInstance()->setModule('customer')->getCustomerDao();
		$customerDao->setDbConnection($conn);
		$exp = array(
				"shop_id"	=> Zend_Auth::getInstance()->getIdentity()->shop->id
				);
		$customers  = $customerDao->find(null,null,$exp);
		$this->view->assign("name",$name);
		$this->view->assign("value",$value);
		$this->view->assign("customers",$customers);
		$this->view->assign("default",$default);
		return $this->view->render('_partial/_listCustomer.phtml');
	}
}
